package scene;

import java.util.Vector;

import javax.media.opengl.GL;

public abstract class VisualObject implements VisualObjectInterface {


	private int name;
	boolean afficher = true;
	boolean etat_detection = true;
	protected double x;
	protected double y, z;
	private String information = "aucune information renseignee";
	private String autreInformation ="";

	private static Vector conteneur_vobject = new Vector();
	private static int cpt_name=0;


	public VisualObject()
	{
		VisualObject.cpt_name=VisualObject.cpt_name+1;
		name=VisualObject.cpt_name;
		conteneur_vobject.addElement(this);

	}

	final protected void dessiner(GL gl)
	{
		gl.glPushMatrix();
		if(this.isEtat_detection()) gl.glPushName(name);
		dessin(gl);
		if(this.isEtat_detection()) gl.glPopName();
		gl.glPopMatrix();

	}

	/**
	 * @return the conteneur_objet3d
	 */
	static public Vector getConteneur_vobject() {
		return conteneur_vobject;
	}

	/**
	 * @return the name
	 */
	final public int getName() {
		return name;
	}

	/**
	 * @return the x
	 */
	final public double getX() {
		return x;
	}

	/**
	 * @param x the x to set
	 */
	public void setX(double x) {
		this.x = x;
	}

	/**
	 * @return the y
	 */
	final public double getY() {
		return y;
	}

	/**
	 * @param y the y to set
	 */
	final public void setY(double y) {
		this.y = y;
	}

	/**
	 * @return the z
	 */
	final public double getZ() {
		return z;
	}

	/**
	 * @param z the z to set
	 */
	public void setZ(double z) {
		this.z = z;
	}

	/**
	 * @return the afficher
	 */
	public boolean isAfficher() {
		return afficher;
	}

	/**
	 * @param afficher the afficher to set
	 */
	public void setAfficher(boolean afficher) {
		this.afficher = afficher;
	}

	/**
	 * @return the etat_detection
	 */
	public boolean isEtat_detection() {
		return etat_detection;
	}

	/**
	 * @param etat_detection the etat_detection to set
	 */
	public void setEtat_detection(boolean etat_detection) {
		this.etat_detection = etat_detection;
	}


	/**
	 * vider le conteneur d'objets visuels
	 */
	static public void viderConteneurObjectVisuels()
	{
		conteneur_vobject=new Vector();


	}

	/**
	 * @return the information
	 */
	public String getInformation() {
		return information;
	}



	/**
	 * @param information the information to set
	 */
	public void setInformation(String information) {
		this.information = information;
	}

	/**
	 * @param information the information to set
	 */
	public void setAutreInformation(String information) {
		this.autreInformation = information;
	}

	/**
	 * @return the information
	 */
	public String getAutreInformation() {
		return autreInformation;
	}


}
